import {request} from '@pkg/request/src';
export enum Api {
  page = '/area/all',
  get = '/area/get',
  save = '/area/save',
  update = '/area/update',
  setHot = '/area/setHot',
  setState = '/area/setState',
  remove = '/area/remove',
}

/**
 * 保存或更新
 * @param params
 * @param isUpdate
 */
export const saveOrUpdate = (params, isUpdate) => {
  const url = isUpdate ? Api.update : Api.save;
  return request.post({url: url, params});
};

/**
 * 查询详情
 * @param params
 */
export const getSysArea = (params) => {
  return request.get({url: Api.get, params});
};
